<template>
	<view>
		<commonHeader :title="$t('oi7')"></commonHeader>
		<view class="gHeadbox"></view>
		<view class="box">
			<view class="box_item" v-for="(item,index) in lisyt" :key="index">
				<image mode="widthFix" class="myVideo" :src="this.$store.state.befurl + item.url"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		onpic
	} from '@/api/home.js'
	export default {
		data() {
			return {
				page: 1,
				pageSize: 10,
				lisyt: [], //数据
				noMoreData: false, // 没有更多数据了
			}
		},
		mounted() {
			this.fncontent()
		},
		// 上拉加载
		onReachBottom() {
			console.log(this.noMoreData)
			if (this.noMoreData) {
				this.page++;
				this.fncontent(); // 获取的数据列表
			}
		},
		methods: {
			fncontent() {
				var params = {
					page: this.page,
					pageSize: this.pageSize
				}
				onpic(params).then(res => {
					if (res.code == 200) {
						console.log(res)
						const infoList = res.data
						this.noMoreData = false;
						if (infoList) {
							this.noMoreData = true;
							this.lisyt = this.lisyt.concat(infoList)
						} else {
							this.noMoreData = false;
						}
					}

				})
			}
		}

	}
</script>

<style scoped lang="scss">
	.box {
		padding: 30rpx;
		box-sizing: border-box;
		height: 100%;

		.box_item {
			background-color: rgba(255, 255, 255, .3);
			padding: 16rpx;
			box-sizing: border-box;
			margin-bottom: 30rpx;
			border-radius: 20rpx;
			overflow: hidden;
		}

		.myVideo {
			width: 100%;
			height: auto;
		}
	}
</style>